<!Doctype html>
<html>

<head>
    <title>oixan的博客</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="Content-Type" content="text/html" ; charset="utf-8">
    <meta name="referrer" content="no-referrer" />
    <link rel="stylesheet" type="text/css" href="../css/blog.css">
    <link rel="stylesheet" type="text/css" href="./bcss/swiper.min.css">
</head>

<body>
    <div class="head">
        <div class="headnav">
            <div class="naveframe">
                <ul class="navlist">
                    <li>
                        <a href="../index.html">
                            主页
                        </a>
                    </li>
                    <li>
                        <a href="../bloglist.html">
                            博客
                        </a>
                    </li>
                    <li>
                        <a href="../about.html">
                            关于
                        </a>
                    </li>
                </ul>
            </div>
        </div>

        <div class="headtext">
            <div class="headtext1">世界很简单，人类很复杂。</div>
            <div class="headtext2">浮生若梦，寻寻觅觅。</div>
        </div>
    </div>

    <div class="contents-all">
        <div class="contents">

            <div class="frame">
                <div class="title">
                    <h3>js通过接口显示外网IP</h3>
                </div>
                <div class="dtime">时间：2018-08-01</div>
                <div class="detail">

                    <p>低版本IE看不了</p>
                    <p></p>
                    <span id="idShow"></span>
                    <script src="https://pv.sohu.com/cityjson?ie=utf-8"></script>
                    <script>
                        
                        var ip = returnCitySN["cip"];
                        var city = returnCitySN["cname"];
                        document.getElementById("idShow").innerHTML = "搜狐接口，<br>你的IP：" + ip + ", " + city 
                        
                    </script>

                    <p></p>
                    <span id="idJsShow"></span>
                    <script>
                        function jsShow(ipdata) {
                            document.getElementById("idJsShow").innerHTML = "太平洋电脑接口，<br>你的IP：" + ipdata.ip + ", " + ipdata.addr;

                        }
                    </script>
                    <script src="https://whois.pconline.com.cn/ipJson.jsp?callback=jsShow&ip="></script>
                    <p></p>


                </div>
                <a href="javascript:void(0)" onclick="showPg()">返回</a>
            </div>

        </div>
    </div>
    <div class="footer">
        <div class="footertext">©2018,oixan博客</div>
    </div>
    <span id="backtop" onclick="topFunction()">返回顶部</span>
    
</body>
<script  src="../js/fanhuiye.js"></script>

</html>